Sorting In-Place with a Worst Case Complexity of n log n-1.3n + O(logn) Comparisons and epsilon n log n + O(1) Transports

نویسنده

  • Klaus Reinhardt
چکیده

First we present a new variant of Merge-sort, which needs only 1.25n space, because it uses space again, which becomes available within the current stage. It does not need more comparisons than classical Merge-sort. The main result is an easy to implement method of iterating the procedure in-place starting to sort 4/5 of the elements. Hereby we can keep the additional transport costs linear and only very few comparisons get lost, so that n log n − 0.8n comparisons are needed. We show that we can improve the number of comparisons if we sort blocks of constant length with Merge-Insertion, before starting the algorithm. Another improvement is to start the iteration with a better version, which needs only (1+ε)n space and again additional O(n) transports. The result is, that we can improve this theoretically up to n log n − 1.3289n comparisons in the worst case. This is close to the theoretical lower bound of n log n − 1.443n. The total number of transports in all these versions can be reduced to ε n log n+O(1) for any ε > 0.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Framework for Speeding Up Priority-Queue Operations

We introduce a framework for reducing the number of element comparisons performed in priority-queue operations. In particular, we give a priority queue which guarantees the worst-case cost of O(1) per minimum finding and insertion, and the worst-case cost of O(log n) with at most log n+O(1) element comparisons per minimum deletion and deletion, improving the bound of 2 logn+ O(1) on the number ...

متن کامل

An In-Place Sorting Algorithm Performing O(n log n) Comparisons and O(n) Data Moves

In this paper we give a positive answer to the long-standing problem of finding an in-place sorting algorithm performing O(n log n) comparisons and O(n) data moves in the worst case. So far, the better in-place sorting algorithm with O(n) moves was proposed by Munro and V. Raman. Their algorithm requires O(n) comparisons in the worst case, for any ǫ > 0. Later, Katajainen and Pasanen discovered...

متن کامل

QuickXsort: Efficient Sorting with n logn - 1.399n + o(n) Comparisons on Average

In this paper we generalize the idea of QuickHeapsort leading to the notion of QuickXsort. Given some external sorting algorithm X, QuickXsort yields an internal sorting algorithm if X satisfies certain natural conditions. With QuickWeakHeapsort and QuickMergesort we present two examples for the QuickXsort-construction. Both are efficient algorithms that incur approximately n log n − 1.26n+ o(n...

متن کامل

In-Place Sorting with Fewer Moves

It is shown that an array of n elements can be sorted using O(1) extra space, O(n log n= log log n) element moves, and n log 2 n+O(n log log n) comparisons. This is the rst in-place sorting algorithm requiring o(n log n) moves in the worst case while guaranteeing O(n log n) comparisons, but due to the constant factors involved the algorithm is predominantly of theoretical interest.

متن کامل

Faster Deterministic Sorting and Searching in Linear Space Tech. Report Lu{cs{tr:95{160

We present a signiicant improvement on linear space deterministic sorting and searching. On a unit-cost RAM with word size w, an ordered set of n w-bit keys (viewed as binary strings or integers) can be maintained in O min p log n; log n log w + log logn; logw log logn time per operation, including insert, delete, member search, and neighbour search. The cost for searching is worst-case while t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1992